<%@ include file="/common/taglibs.jsp"%>

<head>
	<title><fmt:message key="content.title.add" />
	</title>
	<link rel="stylesheet" type="text/css" media="all"
		href="<c:url value='/ext/styles/content/content.css'/>" />
	<script type="text/javascript"
		src="<c:url value='/ext/scripts/date/WdatePicker.js'/>">
</script>
	<script src="<c:url value='/ext/scripts/kindeditor/kindeditor.js'/>"
		type="text/javascript">
</script>
	<script type="text/javascript"
		src="<c:url value='/ext/scripts/index/index.js'/>">
</script>
	<script type="text/javascript">
function getListByProperties(strvalue) {
	return strvalue.split(',');
}

KE.show( {
	id : 'contentconid',
	imageUploadJson : '${ctx}/servlet/uploadjson.do',
	fileManagerJson : '${ctx}/servlet/ContentFileManageJson.do',
	allowFileManager : true,
	resizeMode : 0,
	afterCreate : function(id) {
		KE.event.ctrl(document, 13, function() {
			KE.util.setData(id);
			document.forms['contentform'].submit();
		});
		KE.event.ctrl(KE.g[id].iframeDoc, 13, function() {
			KE.util.setData(id);
			document.forms['contentform'].submit();
		});
	}

});

jQuery(document).ready(
		function() {
			var authoriyvalue = "<fmt:message key='content.type.list'/>";
			var authoriylist = getListByProperties(authoriyvalue);
			var contenttype = document.getElementById("contenttype").value - 0;
			for ( var i = 0; i < authoriylist.length; i++) {
				if (contenttype == (i+1)) {
					jQuery('#ctype').append(
							"<option value='" + (i + 1) + "' selected='selected'>"
									+ authoriylist[i] + "</option>");
				}else{
					jQuery('#ctype').append(
						"<option value='" + (i + 1) + "'>" + authoriylist[i]
								+ "</option>");
				}

			}
			var languageoldid = document.getElementById("languageoldid").value;
			var isrelease = document.getElementById("isreleaseid").value;
			var contenttype = document.getElementById("contenttype").value;
			if (null != languageoldid) {
				if (languageoldid == "EN") {
					document.getElementById("languageen").checked = true;
				}
			}
			if (null != isrelease) {
				if (isrelease == "2") {
					document.getElementById("isreleaseno").checked = true;
				}
			}
		});
</script>
</head>
<div class="box_big">
	<form:form action="../content/addcontent.html" method="post"
		name="contentform">
		<div class="bj_biao">
			<h4>

			</h4>
		</div>
		<div class="box5" id="selectcondiv">
			<table border="0" cellspacing="0" cellpadding="0" class="table_bj"
				align="center">
				<tr height="18">
					<th>
						<input name="contentid" type="hidden" id="conteid"
							value="${contentinfo.contentId}" />
						<input id="languageoldid" name=languageoldid type="hidden"
							value="${contentinfo.language}" />
						<input id="isreleaseid" type="hidden"
							value="${contentinfo.isRelease}" />
						<input id="conttid" type="hidden" value="${contentinfo.content}" />
						<input id="contenttype" type="hidden"
							value="${contentinfo.contentType}" />
						<fmt:message key="content.language" />
						:
					</th>
					<td>
						<fmt:message key="content.language.china" />
						<input name="language" checked="checked" type="radio" value="ZH" />
						<fmt:message key="content.language.english" />
						<input name="language" id="languageen" type="radio" value="EN" />
					</td>
				</tr>
				<tr>
					<th>
						<fmt:message key="content.isrelease" />
						:
					</th>
					<td>
						&nbsp;&nbsp;
						<fmt:message key="content.isrelease.yes" />
						<input name="isrelease" checked="checked" type="radio" value="1" />
						&nbsp;&nbsp;
						<fmt:message key="content.isrelease.no" />
						<input name="isrelease" id="isreleaseno" type="radio" value="2" />
					</td>
				</tr>
				<tr>
					<th>
						<fmt:message key="content.type" />
						:
					</th>
					<td>
						<select name="type" id="ctype" class="text4">
						</select>
					</td>
				</tr>

				<tr>
					<th>
						<fmt:message key="content.title" />
						:
					</th>
					<td>
						<input name="title" type="text" size="45" class="text4"
							value="${contentinfo.contentTitle}" />
					</td>
				</tr>
				<tr>
					<th>
						<fmt:message key="content.content" />
						:
					</th>
					<td>
						<textarea id="contentconid" name="content" rows="20" cols="70">
						
						</textarea>
					</td>
				</tr>
			</table>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr height="50" valign="top">
					<td align="center">
						<input type="submit" value="<fmt:message key="content.add"/>"
							class="btn_blue2" />
						<input type="button" onclick="javascript:history.go(-1);"
							value="<fmt:message key="content.add.back"/>" class="btn_blue2" />
					</td>
				</tr>
			</table>
		</div>
		<input type="hidden" name="thispage" value="${thispage}" />
		<input type="hidden" name="pagename" value="${pagename}" />
	</form:form>
</div>
<script>
var cid = document.getElementById("conteid").value;
var con = document.getElementById("conttid").value;

if (null != cid && cid > 0) {
	document.getElementById("contentconid").innerHTML = con;
}
</script>
